//
//  NWalletCashDetailCell.m
//  News
//
//  Created by zhangtao on 2018/10/10.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NWalletCashDetailCell.h"

@implementation NWalletCashDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)bindData:(WalletFlowModel *)model withType:(NSInteger)type
{
    self.nameLab.text = model.targetBusinessDesc;
    self.timeLab.text = [ACEPublicTool timeIntervalChangeToNowTime:model.flowDate];
    if (model.direction == 1) {
        if (type == 1) {
            self.moneyLab.text = [NSString stringWithFormat:@"+%.2f",[@(model.coin) floatValue]];
        } else {
            self.moneyLab.text = [NSString stringWithFormat:@"+%.2f",[@(model.amount) floatValue]];
        }
    } else if (model.direction == 2) {
        if (type == 1) {
            self.moneyLab.text = [NSString stringWithFormat:@"-%.2f",[@(model.coin) floatValue]];
        } else {
            self.moneyLab.text = [NSString stringWithFormat:@"-%.2f",[@(model.amount) floatValue]];
        }
    }
}

@end
